#include <func.h>

void newHand(int signum,siginfo_t* info,void* a)
{
    printf("sig:%d :请在三秒内测试3号信号\n",signum);
    sleep(3);
    sigset_t pending;
    sigemptyset(&pending);
    sigpending(&pending);
    if(sigismember(&pending,SIGQUIT))
    {
        printf("sig3 is pending\n");
    }else
    {
        printf("there is no sig3\n");

    }
    printf("sig:%d :action is over\n",signum);
}
int main(int argc,char **argv)
{
    struct sigaction act;
    memset(&act,0,sizeof(act));
    act.sa_sigaction =newHand;
    act.sa_flags = SA_SIGINFO;

    //设置mask 将3号信号加入屏蔽
    sigemptyset(&act.sa_mask);
    sigaddset(&act.sa_mask,SIGQUIT);

    sigaction(SIGINT,&act,NULL);
    while(1);
    return 0;
}

